<?php

use Illuminate\Support\Facades\Route;

use App\Http\Middleware\toTokenMiddleware;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
//    return 1;
});


Route::group(['prefix'=>'pc'],function ()
{
    Route::post('login','LoginController@index');
    Route::get('chateToken','LoginController@chateToken')->middleware(toTokenMiddleware::class);
    Route::get('error','LoginController@error');

    Route::group(['prefix'=>'manage'],function ()
    {
        Route::get('get','ManageController@get');
        Route::post('add','ManageController@add');
        Route::post('update','ManageController@update');
        Route::get('del','ManageController@del');

        Route::post('addcollegea','ManageController@addcollegea');
        Route::get('getcollegea','ManageController@getcollegea');
        Route::post('upcollegea','ManageController@upcollegea');
        Route::get('delcollegea','ManageController@delcollegea');

        Route::post('addclass','ManageController@addclass');
        Route::get('getclass','ManageController@getclass');
        Route::post('upclass','ManageController@upclass');
        Route::get('delclass','ManageController@delclass');


        Route::post('addbook','ManageController@addbook');
        Route::get('getbook','ManageController@getbook');
        Route::post('upbook','ManageController@upbook');
        Route::get('delbook','ManageController@delbook');


        Route::post('addstudent','ManageController@addstudent');
        Route::post('addteacer','ManageController@addteacer');
        Route::post('addmanage','ManageController@addmanage');

        Route::post('upstudent','ManageController@upstudent');
        Route::post('upteacer','ManageController@addteacer');
        Route::post('upmanage','ManageController@addmanage');
    });
    Route::group(['prefix'=>'classes'],function (){
        Route::get('classfoteacher','ClassController@classfoteacher');
        Route::post('addclassfoteacher','ClassController@addclassfoteacher');
        Route::post('upclassfoteacher','ClassController@upclassfoteacher');
        Route::post('delclassfoteacher','ClassController@delclassfoteacher');
    });
});

